package com.GroupSix.controller;


import com.GroupSix.service.StudentScoreService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/studentScore")
public class StudentScoreController {

    @Autowired
    private StudentScoreService studentScoreService;

    @PostMapping("/getDetail")
    public Map<String,Object> getDetail(@RequestParam("stuId") int stuId,
                                        @RequestParam("examId") int exanId) {
        return studentScoreService.getStudentScoreDetail(stuId,exanId);
    }

    @PostMapping("show")
    public List<Map<String, Object>> show(){
       return studentScoreService.show();
    }
}
